package model;

/**
 * This class holds the price and type for items or services.
 * 
 * @author Matthew Edwards 
 * @version 3-5-11
 */

public class Item{
    
    private String name;
    
    private Price price;

	/**
	 * This constructor takes in two parameters, name and price. It takes in the
	 * name of the item and the price.
	 * 
	 * @param name
	 *            Takes in this parameter of type String to use as the name of
	 *            the item.
	 * @param price
	 *            Takes in the price as an int.
	 */
    public Item(String name, Price price){
        this.name = name;
        this.price = price;
    }
    
    /**
     * This getter gets the name of the item and returns it as a string. 
     *  
     * @return The item's name as a String. 
     */ 
    public String getName(){
        return name;
    }
    
    /**
     * Sets the name of the item by taking in a String.
     * 
     * @param input Takes in the String of the name of the Item.
     */
    public void setName(String input){
        name = input;
    }
    
    /**
     * This getter gets the price of the item and returns it as a String. 
     * 
     * @return The price of the item as an int. 
     */
    public Price getPrice(){
        return price;
    }
    
    /**
     * This method sets the price of the item by taking in an int. 
     * 
     * @param input The price of the Item taken in as an int. 
     */
    public void setPrice(Price input){
        price = input;
    }
    
    /**
     * ex: NameOfItem: PriceOfItem
     * 
     * @return the item.
     */
    public String toString(){
    	return name + ": " + price.toString();
    }

}